<template>
  <div class="demo">
    <template>
      <div v-if="mode === 'edit'">
        <el-tooltip
          :effect="tipEffect?'dark':'light'"
          :content="tipMsg"
          :placement="tipPlacement"
        >
          <el-button>提示</el-button>
        </el-tooltip>
      </div>
      <div v-else>{{ value }}</div>
    </template>
  </div>
</template>

<script>
import datasource from "../../mixins/steps-datasource";
export default {
  name: "toast",
  mixins: [datasource],
  components: {},
  props: {
    value: {},
    mode: {
      default: "edit", // 编辑模式和 edit， 展示模式 view
    },
    readonly: {
      type: Boolean,
      default: false,
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    tipEffect:{
      type: Boolean,
      default: false,
    },
    tipPlacement:{
      default:''
    },
    tipMsg:{
      default:''
    }
  },
  data() {
    return {
      tipPlacement:"",
      tipMsg:"",
    };
  },

  watch: {},
  mounted() {
    this.$emit("input", this.tipMsg)
    if (this.value) {
      this.tipMsg = this.value;
      if (this.mode == "view") {
        this.disabled = true;
      }
    }
  },
  computed: {},
  methods: {
  },
};
</script>
<style lang="scss" scoped>
.demo {
  width: 100%;
}
</style>
